﻿using System;
using System.Collections.Generic;
using System.Text;
using FDSQLAssistant.Models;

namespace FDSQLAssistant.Services
{
    public class BusinessManager : IBusinessManager
    {
        private readonly IGenerator _generator;

        public BusinessManager(IGenerator generator)
        {
            _generator = generator;
        }

        public string GetSql(string tableName, string condition, BuzType buzType)
        {
            switch (buzType)
            {
                case BuzType.Insert:
                    return _generator.InsertSql(tableName);
                case BuzType.Update:
                    return _generator.UpdateSql(tableName, condition);
                case BuzType.Select:
                    return _generator.QuerySql(tableName, condition);
                case BuzType.Delete:
                    return _generator.DeleteSql(tableName, condition);
                default:
                    return string.Empty;
            }
        }
    }
}
